home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / ewl / ewl_spectrum.h < prev    next >
C/C++ Source or Header  |  2006-01-09  |  2KB  |  80 lines

  1. #ifndef EWL_SPECTRUM_H
  2. #define EWL_SPECTRUM_H
  3.  
  4. /**
  5.  * @file ewl_spectrum.h
  6.  * @defgroup Ewl_Spectrum Spectrum The colour spectrum widget
  7.  *
  8.  * @{
  9.  */
  10.  
  11. /**
  12.  * @def EWL_SPECTRUM(sp)
  13.  * Typecasts a pointer to an Ewl_Spectrum pointer.
  14.  */
  15. #define EWL_SPECTRUM(sp) ((Ewl_Spectrum *)sp)
  16.  
  17. /**
  18.  * Provides a colour spectrum.
  19.  */
  20. typedef struct Ewl_Spectrum Ewl_Spectrum;
  21.  
  22. /**
  23.  * Inherits from Ewl_Overlay and extends to privide a colour spectrum 
  24.  */
  25. struct Ewl_Spectrum 
  26. {
  27.     Ewl_Overlay overlay;
  28.     Ewl_Widget *canvas;
  29.     
  30.     struct 
  31.     {
  32.         Ewl_Widget *vertical;
  33.         Ewl_Widget *horizontal;
  34.     } cross_hairs;
  35.  
  36.     Ewl_Color_Set rgb;
  37.     struct {
  38.         double h;
  39.         double s;
  40.         double v;
  41.     } hsv;
  42.  
  43.     Ewl_Color_Mode mode;
  44.     Ewl_Spectrum_Type type;
  45. };
  46.  
  47. Ewl_Widget    *ewl_spectrum_new(void);
  48. int         ewl_spectrum_init(Ewl_Spectrum *sp);
  49.  
  50. void          ewl_spectrum_type_set(Ewl_Spectrum *sp, Ewl_Spectrum_Type type);
  51. Ewl_Spectrum_Type ewl_spectrum_type_get(Ewl_Spectrum *sp);
  52.  
  53. void         ewl_spectrum_mode_set(Ewl_Spectrum *sp, Ewl_Color_Mode mode);
  54. Ewl_Color_Mode     ewl_spectrum_mode_get(Ewl_Spectrum *sp);
  55.  
  56. void         ewl_spectrum_rgb_set(Ewl_Spectrum *sp, unsigned int r, 
  57.                     unsigned int g, unsigned int b);
  58. void         ewl_spectrum_rgb_get(Ewl_Spectrum *sp, unsigned int *r,
  59.                     unsigned int *g, unsigned int *b);
  60.  
  61. void         ewl_spectrum_hsv_set(Ewl_Spectrum *sp, double h,
  62.                         double s, double v);
  63. void         ewl_spectrum_hsv_get(Ewl_Spectrum *sp, double *h,
  64.                         double *s, double *v);
  65.  
  66. /*
  67.  * Internally used callbacks, override at your own risk.
  68.  */
  69. void ewl_spectrum_cb_configure(Ewl_Widget *w, void *ev, void *data);
  70. void ewl_spectrum_cb_mouse_down(Ewl_Widget *w, void *ev, void *data);
  71. void ewl_spectrum_cb_mouse_move(Ewl_Widget *w, void *ev, void *data);
  72. void ewl_spectrum_cb_mouse_up(Ewl_Widget *w, void *ev, void *data);
  73.  
  74. /**
  75.  * @}
  76.  */
  77.  
  78. #endif
  79.  
  80.